#pragma once

#include <vector>
#include <string>


class OptParser {

public:

	OptParser(int argc, char* argv[], char* pattern, bool exit_on_error);

	// Return the ascii of the option, NULL when no options remain,
	// 1 when param is directly given, -1 when error.
	int next_opt();

	// Store the content of param.
	std::string param;

private:

    bool exit_on_error;

    int argc;
    std::vector<char*> argv;

	// Storing the number of colons, -1 means no suc option.
	// Index of the vector is ascii
	std::vector<int> options;

	int argv_index;
};